package park;

import java.util.Scanner;

public class J09Account {
	
	public static void main(String [] args){
		
		
		int aid[] = new int[2]; // 계좌번호
		double balance[] = new double[2]; // 잔액
		double interestRate[] = new double[2]; // 연이율
		final String dateCreated = "2014.03.10";
		double getMonthlyInterestRate[] = new double[2];
		double withDraw[] = new double[2];
		double deposit[] = new double[2];
		
		inputAccount(aid,interestRate,dateCreated,deposit,withDraw);
		getMonthlyInterestRate(getMonthlyInterestRate,interestRate);
		withDraw(balance,withDraw);
		deposit(balance,deposit);

		
	}//main
	
		//예금,이자율,인출,입금 정보입력
	
		public static void inputAccount(
				int aid[],double interestRate[],String dateCreated,
				double deposit[],double withDraw[]){
			
			Scanner sc = new Scanner(System.in);
			
			System.out.println("계좌번호는?");
			aid[1] = sc.nextInt();
			System.out.println("연간 이자율은?");
			interestRate[1] = sc.nextDouble();
			System.out.println("통장 개설일은?");
			dateCreated = sc.next();
			System.out.println("입금액은?");
			deposit[1] = sc.nextDouble();
			System.out.println("출금액은?");
			withDraw[1] = sc.nextDouble();
			
			System.out.println("계좌" + aid[1]);
			System.out.println("연간이자" + interestRate[1] + "%");
			System.out.println("통장 개설날짜는" + dateCreated);
			System.out.println("입금액은" + deposit[1] + "원");
			System.out.println("출금액은" + withDraw[1] + "원");
			
			
			
			
			sc.close();
					
		}

		
		//월간 이자율 계산
		public static void getMonthlyInterestRate(
				double getMonthlyInterestRate[],double interestRate[]){
			
			getMonthlyInterestRate[1] = interestRate[1] / 12;
			
			System.out.println("월간 이자율은?"+getMonthlyInterestRate[1]);
			
		}//monthly


		//인출
		
		public static void withDraw(
				double balance[], double withDraw[]){
			
			balance[1] = balance[1] - withDraw[1]; // 출금
			
			System.out.println("출금은"+balance[1]);
			
		}//withdraw
		
		
		//잔액
		public static void deposit(
				double balance[],double deposit[]){
			
			balance[1] = balance[1] + deposit[1]; // 입금
			
			System.out.println("잔액은"+balance[1]);
			
		}//deposit

}//class
